import { defineConfig, utils } from "umi";
import routes from "./routes";
import proxy from "./proxy";

const { winPath } = utils;
export default defineConfig({
  // 通过 package.json 自动挂载 umi 插件，不需再次挂载
  // plugins: [],
  routes: routes,
  history: { type: "hash" },
  publicPath: "./",
  antd: {},
  fastRefresh: {},
  // mfsu: {},
  proxy: proxy,
  dva: {
    hmr: true,
  },
  targets: {
    ie: 10,
  },
  locale: {
    default: "zh-CN",
    baseNavigator: true,
  },
  dynamicImport: {
    // 无需 level, webpackChunkName 配置
    loading: "@/components/PageLoading/PageLoading",
  },

  // 配置额外的css， 如iconfont
  // styles: ['http://192.168.0.1/style.css'],

  // 配置less全局变量
  // theme: {
  //    '@primary-color': '#1DA57A'
  // }
  dynamicImportSyntax: {},

  // 暂时关闭
  pwa: false,
  lessLoader: { javascriptEnabled: true },
});
